# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         demo1061
# Description:
# Author:       yzl
# Date:         2019-02-07
#-------------------------------------------------------------------------------

nestedList = [[1,2,3],[4,3,2],[1,2,4,5,7]]

def enumList(nestedList):
    for subList in nestedList:
        for element in subList:
            yield element


# 对生成器函数进行迭代
for num in enumList(nestedList):
    print(num,end=' ')

print()
# 将生成器函数转换成列表
numList = list(enumList(nestedList))
print(numList)
print(numList[1:5])

